import { ConfigManager } from "../../../com/gengine/resource/ConfigManager";
import { TPetReincarnate } from "../../../Message/Db/Tables/TPetReincarnate";
type int = number;
//class PetReincarnateConfig
    
    export  class PetReincarnateConfig
    {
        constructor()
        {
            
            var loc1=ConfigManager.instance.getJSONByFileName("t_pet_reincarnate.json");
            this._dic = new Map<any, any> /* flash.utils.Dictionary */();
            this.write(loc1);
            return;
        }

        /* internal  */write(arg1: Object): void
        {
            var loc1=null;
            var loc2=null;
            var loc3=0;
            var loc4=arg1;
            for(loc2 of loc4) 
            {
                loc1 = new TPetReincarnate();
                loc1.type = loc2.type;
                loc1.code = loc2.code;
                loc1.amount = loc2.amount;
                loc1.unit = loc2.unit;
                loc1.cost = loc2.cost;
                loc1.wuxingAttrAdd = loc2.wuxingAttrAdd;
                this._dic[loc1.type] = loc1;
            }
            return;
        }

        public getItemByTpye(arg1: int): TPetReincarnate
        {
            return this._dic[arg1] as TPetReincarnate;
        }

        public static get instance(): PetReincarnateConfig
        {
            if (!PetReincarnateConfig._instance) 
            {
                PetReincarnateConfig._instance = new PetReincarnateConfig();
            }
            return PetReincarnateConfig._instance;
        }

        /* internal */ /* var */_dic: Map<any, any> /* flash.utils.Dictionary */;

        /* internal */ static /* var */_instance: PetReincarnateConfig;
    }
